Linux 下安装Oracle
1、 检查系统环境
Cpu:
[root@db_master ~]# grep "modelname" /proc/cpuinfo
model name :Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz
model name :Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz
model name :Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz
model name :Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz
内存:
[root@db_master ~]# grep MemTotal/proc/meminfo
MemTotal: 3264544 kB
[root@db_master ~]# grep SwapTotal/proc/meminfo
SwapTotal: 8289532 kB
内存:
[root@db_master ~]# free -g
total used free shared buffers cached
Mem: 3 0 2 0 0 0
-/+ buffers/cache: 0 3
Swap: 7 0 7
磁盘:
查看机器:
[root@db_master ~]# uname -a
Linux db_master 2.6.18-194.el5 #1 SMP TueMar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@db_master ~]# more/etc/redhat-release
Red Hat Enterprise Linux Server release 5.5(Tikanga)
2、 检查安装的rpm包
检查包是否安装
[root@db_master ~]# rpm -q binutilscompat-libstdc elfutils-libelf elfutils-libelf-devel gcc gcc-c glibc glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdclibstdc++-devel make sysstat unixODBCunixODBC-devel
binutils-2.17.50.0.6-14.el5
package compat-libstdc is not installed
elfutils-libelf-0.137-3.el5
elfutils-libelf-0.137-3.el5
elfutils-libelf-devel-0.137-3.el5
gcc-4.1.2-48.el5
package gcc-c is not installed
glibc-2.5-49
glibc-2.5-49
package glic-devel is not installed
glibc-headers-2.5-49
ksh-20100202-1.el5
libaio-0.3.106-5
libaio-0.3.106-5
package libaio-devel is not installed
libgcc-4.1.2-48.el5
libgcc-4.1.2-48.el5
package libstdc is not installed
libstdc++-devel-4.1.2-48.el5
make-3.81-3.el5
package sysstat is not installed
unixODBC-2.2.11-7.1
unixODBC-2.2.11-7.1
package unixODBC-devel is not installed
安装未安装的包:如下安装方法
插入光盘:mount /dev/cdrom /mnt
cd mnt/Server
[root@db_master Server]# rpm -ivhlibaio-devel-0.3.106-5.i386.rpm
warning: libaio-devel-0.3.106-5.i386.rpm:Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:libaio-devel ########################################### [100%]
[root@db_master Server]# rpm -ivhlibaio-devel-0.3.106-5.x86_64.rpm
warning: libaio-devel-0.3.106-5.x86_64.rpm:Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:libaio-devel ###########################################[100%]
3、 系统配置
(1)新建用户和组
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
id oracle
uid=500(oracle) gid=501(oinstall)groups=501(oinstall),500(dba)
[root@db_master /]# passwd oracle
Changing password for user oracle.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updatedsuccessfully.
(2)创建安装目录
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
(3)关闭防火墙SELINUX
4、 系统内核修改
(1) 查看系统内核
[root@db_masterapp]# cat /etc/sysctl.conf
net.ipv4.ip_forward= 0
net.ipv4.conf.default.rp_filter= 1
net.ipv4.conf.default.accept_source_route= 0
kernel.sysrq = 0
kernel.core_uses_pid= 1
net.ipv4.tcp_syncookies= 1
kernel.msgmnb =65536
kernel.msgmax =65536
kernel.shmmax =68719476736
kernel.shmall =4294967296
修改或增加如下:
net.ipv4.ip_forward= 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route= 0
net.ipv4.conf.default.rp_filter= 1
net.ipv4.conf.default.accept_source_route= 0
kernel.sysrq = 0
kernel.core_uses_pid= 1
net.ipv4.tcp_syncookies= 1
kernel.msgmnb =65536
kernel.msgmax =65536
kernel.shmmax =68719476736
kernel.shmall = 2097152
kernel.shmmni=4096
kernel.sem=25032000 100 128
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576
net.ipv4.ip_local_port_range=900065500
fs.file-max=6815744
fs.aio-max-nr=1048576
算法:
kernel.shmall =physicalRAM size / pagesize (getconf PAGESIZE) -- If the defaults are greater thenleave it.
kernel.shmall = 内存大小/4k=23G*1024*1024/4k= 6029312
kernel.shmmax =20*1024*1024=20971520 而默认的为68719476736,那么使用默认值
使用sysctl –p 验证配置如果写错会报错如下
正确:
5、 设置用户限制
在/etc/security/limits.conf下修改用户限制
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
在login中增加一行如图最后一句
6、 配置系统/etc/profile
增加下面文字:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
7、 配置oracle环境变量
切换到oracle主目录 : vi .base_profile
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startupprograms
PATH=$PATH:$HOME/bin
export PATH
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
ORACLE_SID=slave
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SIDLD_LIBRARY_PATH DISPLAY
stty erase ^H
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrar"
使配置生效:
# Source .base_profile
8、 解压镜像文件
[root@db_master linux]# unziplinux.x64_11gR2_database_1of2.zip
[root@db_master linux]# unzip linux.x64_11gR2_database_2of2.zip
9、 安装rlwrap 用于sqlplus 上下(在可以放在第一步安装)
10、安装oracle软件
配置xmanager display=笔记本地址:0.0
. oraenv
链接文字
由社区会员 wudiyuqing 长春嘉诚 软件开发工程师 分享
长按下图二维码关注
也可以直接搜索公众号名称“AIX专家俱乐部”或微信号“AIXChina”关注
↓↓↓